package com.ouc.pampas;

import java.io.Serializable;
import java.util.Set;
import java.util.regex.Pattern;

public class WhiteAuth
  implements Serializable
{
  private static final long serialVersionUID = 3696648541366561019L;
  private String pattern;
  private Pattern regexPattern;
  private Set<HttpMethod> methods;
  
  public String toString()
  {
    return "WhiteAuth(pattern=" + getPattern() + ", regexPattern=" + getRegexPattern() + ", methods=" + getMethods() + ")";
  }
  
  public String getPattern()
  {
    return this.pattern;
  }
  
  public void setPattern(String pattern)
  {
    this.pattern = pattern;
  }
  
  public Pattern getRegexPattern()
  {
    return this.regexPattern;
  }
  
  public void setRegexPattern(Pattern regexPattern)
  {
    this.regexPattern = regexPattern;
  }
  
  public Set<HttpMethod> getMethods()
  {
    return this.methods;
  }
  
  public void setMethods(Set<HttpMethod> methods)
  {
    this.methods = methods;
  }
  
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if (!(o instanceof WhiteAuth)) {
      return false;
    }
    WhiteAuth whiteAuth = (WhiteAuth)o;
    if (!this.pattern.equals(whiteAuth.pattern)) {
      return false;
    }
    return true;
  }
  
  public int hashCode()
  {
    return this.pattern.hashCode();
  }
}

